﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GtsServer.DAL;
using GtsServer.Common;
using System.Data;
using GtsServer.Model;

namespace GtsServer.Manage.Controller
{
    public class NewDeliveryController
    {
        NewDeliveryDAL NewsDelidal = new NewDeliveryDAL();
        public int Add(NewDeliveryMould model)
        {
            return NewsDelidal.Add(model);
        }

        public bool Update(NewDeliveryMould model)
        {
            return NewsDelidal.Update(model);
        }

        public bool Delete(int id)
        {
            return NewsDelidal.Delete(id);
        }
        public List<NewDeliveryMouldShow> GetList(int pageIndex, int pageSize, out int count)
        {
            count = 0;
            DataSet ds = NewsDelidal.GetList(pageIndex, pageSize);
            count = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
            return IListDataSet.DataSetToIList<NewDeliveryMouldShow>(ds, 0).ToList();
        }
    }
}
